<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
  Code Syntax Highlighter
  Version 1.5.2
  Copyright (C) 2004-2008 Alex Gorbatchev
  http://www.dreamprojections.com/syntaxhighlighter/
 
   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, version 3 of the License.
 
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
 
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Test.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>dp.SyntaxHighlighter Tests</title>
<link type="text/css" rel="stylesheet" href="Styles/SyntaxHighlighter.css">
</link>
<link href="Styles/TestPages.css" rel="stylesheet" type="text/css">
</link>
</head>
<body>
<h1>dp.SyntaxHighlighter 1.5.2 Tests and Samples</h1>
<p><a href="http://code.google.com/p/syntaxhighlighter/">http://code.google.com/p/syntaxhighlighter/</a></p>
<h2><!-- InstanceBeginEditable name="Title" -->Python<!-- InstanceEndEditable --></h2>
<div class="layout">
	<div class="column1">
		<h3>Languages:</h3>
		<ol>
			<li><a href="CSharp.html">C#</a></li>
			<li><a href="CSS.html">CSS</a></li>
			<li><a href="Cpp.html">C++</a></li>
			<li><a href="Delphi.html">Delphi</a></li>
			<li><a href="Java.html">Java</a></li>
			<li><a href="JavaScript.html">JavaScript</a></li>
			<li><a href="PHP.html">PHP</a></li>
			<li><a href="Python.html">Python</a></li>
			<li><a href="Ruby.html">Ruby</a></li>
			<li><a href="SQL.html">SQL</a></li>
			<li><a href="VB.html">Visual Basic</a></li>
			<li><a href="XML.html">XML / HTML</a></li>
			<li><a href="Scala.html">Scala</a></li>
			<li><a href="Groovy.html">Groovy</a></li>
			<li><a href="Bash.html">Bash</a></li>
		</ol>
		<h3>Features:</h3>
		<ol>
			<li><a href="SmartTabs.html">Smart tabs</a></li>
			<li><a href="FirstLine.html">First line</a> </li>
			<li><a href="CollapseCode.html">Expand code</a></li>
			<li><a href="ShowColumns.html">Show columns</a></li>
			<li><a href="Blogger.html">Blogger integration</a></li>
			<li><a href="NoGutter.html">No gutter</a></li>
			<li><a href="NoControls.html">No controls</a></li>
		</ol>
		<h3>Issues:</h3>
		<ol>
			<li><a href="Issues/Issue7.xml">#7, XSL transformation</a></li>
			<li><a href="Issues/Issue15.html">#15, Incorrect single quote</a></li>
			<li><a href="Issues/Issue10.html">#10, VB crash</a></li>
			<li><a href="Issues/Issue19.html">#19, No matches</a></li>
		</ol>
	</div>
	<div class="column2">
		<div class="block-box">Block before.</div>
		<!-- InstanceBeginEditable name="Code" -->
<pre name="code" class="python">
"""
Comment\"
string
"""

cache = {}

string s = "## comments inside a string"
string str = "helllo \"world\", how things?" + 10 + "word" + "hello" # and " some more here

def arrange(plans, lines, totalMinutes):
    """arrangements of plans taken lines times with an heuristic that the sum
       of values in one arrangement is less then totalMinutes
    """
    #if in cache we are done otherwise start calculating and save them to cache
    if (plans, lines, totalMinutes) in cache:
        return cache[(plans, lines, totalMinutes)]
    if lines==1:
        r = [[plan] for plan in plans]
        cache[(plans, lines, totalMinutes)] = r
        return r
    solutions = []
    for plan in plans:
        for ar in sort(list(arrange(plans, lines-1, totalMinutes))):
            try:
                one_solution = tuple(sort([plan] + list(ar)))
                if sum(one_solution) &lt;= totalMinutes and one_solution not in solutions:
                    solutions.append(one_solution)
            except Exception, e:
                print "Error:", str(e)
    cache[(plans, lines, totalMinutes)] = solutions
    return solutions

if __name__ == "__main__":
    import sys
    lines, totalMinutes = int(sys.argv[1]), int(sys.argv[2])
    plans = tuple([int(p) for p in sys.argv[3:]])
    print "for", lines, totalMinutes, plans
    for sol in arrange(plans, lines, totalMinutes):
        print sol
</pre>
<!-- InstanceEndEditable -->
		<div class="block-box">Block after.</div>
	</div>
</div>
<div class="footer"> Copyright 2004-2008 Alex Gorbatchev.<br/>
</div>
<script class="javascript" src="Scripts/shCore.js"></script>
<script class="javascript" src="Scripts/shBrushCSharp.js"></script>
<script class="javascript" src="Scripts/shBrushPhp.js"></script>
<script class="javascript" src="Scripts/shBrushJScript.js"></script>
<script class="javascript" src="Scripts/shBrushJava.js"></script>
<script class="javascript" src="Scripts/shBrushVb.js"></script>
<script class="javascript" src="Scripts/shBrushSql.js"></script>
<script class="javascript" src="Scripts/shBrushXml.js"></script>
<script class="javascript" src="Scripts/shBrushDelphi.js"></script>
<script class="javascript" src="Scripts/shBrushPython.js"></script>
<script class="javascript" src="Scripts/shBrushRuby.js"></script>
<script class="javascript" src="Scripts/shBrushCss.js"></script>
<script class="javascript" src="Scripts/shBrushCpp.js"></script>
<script class="javascript" src="Scripts/shBrushScala.js"></script>
<script class="javascript" src="Scripts/shBrushGroovy.js"></script>
<script class="javascript" src="Scripts/shBrushBash.js"></script>
<script class="javascript">
      if(window.isBloggerMode == true)
      dp.SyntaxHighlighter.BloggerMode();
      
      dp.SyntaxHighlighter.ClipboardSwf = 'Scripts/clipboard.swf';
      dp.SyntaxHighlighter.HighlightAll('code');
    </script>
</body>
<!-- InstanceEnd --></html>
